<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html>
  <head> 
    <title>指标历史数据录入</title>  
    <jsp:include page="/include.jsp"/>
    <script type="text/javascript">
    //新增
    function doAdd(){
    	window.top.$('<div/>').dialog({
			href:'${pageContext.request.contextPath}/dqm/mininganalysis/dataImport/dataimport_add.jsp',
			top:($(window.top).height()-400)*0.5,
		    left:($(window.top).width()-600)*0.5,
			width:800,
			height:500,
			modal:true,
			title:'指标数据录入',
			onClose : function() {
				window.top.$(this).dialog('destroy');
				$('#table_datagrid').datagrid('reload');
			}
		});
    }
 
    //详细
    function doDetail(operationid){
    	window.top.$('<div/>').dialog({
			href:'${pageContext.request.contextPath}/mininganalysis/dataImportAction!detailDataImportByOperationid.action?operationid='+operationid,
			top:($(window.top).height()-400)*0.5,
		    left:($(window.top).width()-600)*0.5,
			width:600,
			modal:true,
			title:'数据录入详细信息',	
			buttons:[{
				text:'关 闭',
				iconCls:'',
				handler:function(){
					var d=window.top.$(this).closest('.window-body');
					d.dialog('destroy'); 
				}
			}],
			onClose:function(){
				window.top.$(this).dialog('destroy');
			}
		});
    }
    //执行查询
    function doQuery(){
    	var kqiname=$('#kqinameQ').val();
    	var dataimporttype=$('#dataimporttypeQ').combobox('getValue');
        var creator=$('#creatorQ').val();
    	var query={kqiname:kqiname,dataimporttype:dataimporttype,creator:creator}; //把查询条件拼接成JSON
    	$('#table_datagrid').datagrid('options').queryParams=query; //把查询条件赋值给datagrid内部变量
    	$('#table_datagrid').datagrid('reload'); //重新加载
    }
    
    function doReset(){
       	$('#kqinameQ').val('');
    	$('#creatorQ').val('');
    	//$('#dataimporttypeQ').val('');
    	$('#dataimporttypeQ').combobox('setValue',"");
    	
    }
    
    

    //页面加载完后响应 onReady
	$(function() {
		//新增按纽绑定事件
		$('#add').bind('click',doAdd);
		//查询按纽绑定事件
		$('#btnQuery').bind('click',doQuery);

		//初始化主列表
		$('#table_datagrid').datagrid({
			url:'${pageContext.request.contextPath}/mininganalysis/dataImportAction!getAllOperationLogList.action',
			fit:true,
			border:false,
			fitColumns:true,
			pagination:true,
			pageList:[10,20,30],
			singleSelect:true,
			sortName:'createtime',
			sortOrder:'desc',			
			/* pagePosition:'both', */
			columns:[[
			          {field:'kqiid',title:'KQIID',width:150,hidden:true},
			          {field:'kqiname',title:'指标名称',width:60,align:'left',sortable:true,formatter:function(value,rowData,rowIndex){
				            // return '<a title="'+rowData.kqiname+'" onclick="doDetail('+rowData.operationid+')" onmouseover="onMouseOverName(this)"  onmouseout="onMouseOutName(this)" style="color:#398ece;cursor:pointer;">'+rowData.kqiname+'</a>';
			        	       return '<div  onmouseover="onMouseOverName(this)"  onmouseout="onMouseOutName(this)" onclick="doDetail('+rowData.operationid+')" style="color:#2b76b7;cursor:pointer;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;" title="'+rowData.kqiname+'">'+rowData.kqiname+'</div>'; 
				       }},  
			          {field:'kqiversionnum',title:'版本号',width:50,align:'center'},
			          {field:'dataimporttype',title:'录入方式',width:80,sortable:true,align:'center'},
			          {field:'successline',title:'成功入库条数',width:50,sortable:true,align:'center'},
			          {field:'failline',title:'失败条数',width:50,sortable:true,align:'center'},
			          {field:'creator',title:'录入责任人',width:80,align:'center'},
			          {field:'createtime',title:'录入时间',width:100,sortable:true,align:'center'},
			          ]],
			toolbar:'#toolbar'
		});
	});
</script>
<body class="easyui-layout">  
	<form id="query_form" method="post">
	    <div data-options="region:'north'" style="height:80px;border-bottom:none;border-top:none;">
	    	<table border="0" cellpadding="0" cellspacing="0" height="100%"  width="100%" >
	    	    <tr>
	    			<td style="width:10%;text-align:right;" nowrap="nowrap">
	    			   <label for="kqinameQ"> 指标名称：</label>
	    			</td>
	    			<td style="width:15%;text-align:left;" nowrap="nowrap">
	    				<input validType="specialCharFilter('kqinameQ')" type="text" id="kqinameQ" name="kqinameQ" class="easyui-validatebox" />
	    			</td>
	    			<td style="width:10%;text-align:right;" nowrap="nowrap">
	    			    <label for="dataimporttypeQ">录入方式：</label>
	    			</td>
	    			<td style="width:15%;text-align:left;" nowrap="nowrap">	    				
	    				<select id="dataimporttypeQ" name="dataimporttypeQ" class="easyui-combobox" panelHeight='auto' style="width:180px;">
							<option value="">全部</option>
							<option value="0">批量导入</option>
							<option value="1">手工录入</option>
						</select>
	    			</td>
	    			<td style="width:10%;text-align:right;" nowrap="nowrap">
	    			   <label for="creatorQ">&nbsp;&nbsp;录入责任人：</label>
	    			</td>
	    			<td style="width:15%;text-align:left;" nowrap="nowrap">	    				
	    				<input validType="specialCharFilter('creatorQ')" type="text" id="creatorQ" class="easyui-validatebox" />
	    			</td>
	    			<td colspan="2" style="width:25%;text-align:right;" nowrap="nowrap">
	    			   <input type="button" id="btnQuery" name="" value="查询" onclick="doQuery()" style="cursor:pointer;background-image: url('${pageContext.request.contextPath}/images/login/search.png');background-repeat: no-repeat;width:67px;height:23px;padding-left:12px;border:none;color:white;font-family:微软雅黑"/>			
			    		<input type="button" id="btnReset" name="" value="重置" onclick="doReset()"  style="cursor:pointer;background-image: url('${pageContext.request.contextPath}/images/login/reset.png');background-repeat: no-repeat;width:67px;height:23px;padding-left:12px;border:none;color:white;font-family:微软雅黑;margin-right:55px;"/>			
	    			</td>
	    		</tr>
	    	</table>	    	
	    </div>  
	    <div data-options="region:'center'" style="border-top:none">  
	        <table id="table_datagrid"> 
			</table>
			<div id="toolbar" class="etl_panel_title" >				
				<a id="add" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"  style="float:left">新增</a>
				<div class="datagrid-btn-separator"></div>
				<a id="btnConfig" href="#" class="easyui-linkbutton" data-options="iconCls:'',plain:true" ></a>											 
			</div>  
	    </div>  
    </form>
</body>  
</html>

